<template>
    <page-layout>
        <!-- 在 -->
        <div style="color:#000">1234</div>
        <a-button style="width: 100%" class="captcha-button" size="large" @click = 'onButton'>这是个按钮</a-button>
    </page-layout>
</template>

<script>
import PageLayout from '@/layouts/PageLayout' 
import {mapState, mapMutations, mapGetters} from 'vuex'
//二次封装的页面布局，控件名为 page-layout

// import {mapState} from 'vuex'
// import {request, METHOD} from '@/utils/request'

  export default {
    name: '莫维春首页',
    components: {PageLayout}, //加载布局
    computed: {
      ...mapGetters('setting', ['firstMenu', 'subMenu', 'menuData']),
    },
    methods: {
      ...mapMutations('setting', ['correctPageMinHeight', 'setActivatedFirst','setMenuData']),
      onButton(){
        debugger ;
        // this.setMenuData(JSON.parse('[{"path":"mo","name":"新菜单","meta":{"icon":"transaction","authority":{"permission":"*"},"pAuthorities":[{"permission":"*"}]},"component":{"name":"BlankView","components":{"PageToggleTransition":{"name":"PageToggleTransition","props":{"disabled":{"default":false},"animate":{"default":"bounce"},"direction":{},"reverse":{"default":true}},"computed":{},"methods":{},"staticRenderFns":[],"_compiled":true,"beforeCreate":[null],"beforeDestroy":[null],"__file":"src/components/transition/PageToggleTransition.vue","_Ctor":{}}},"computed":{},"staticRenderFns":[],"_compiled":true,"_scopeId":"data-v-2172e1ea","beforeCreate":[null],"beforeDestroy":[null],"__file":"src/layouts/BlankView.vue","_Ctor":{}},"children":[{"path":"myPage","name":"1234","meta":{"page":{"closable":true,"cacheAble":false},"authority":{"permission":"*"},"pAuthorities":[{"permission":"*"},{"permission":"*"}]},"fullPath":"/mo/myPage"}],"fullPath":"/mo"}]'));
        let a = [{
            name: '新菜单',
            path: 'demo',
            meta: {
              icon: 'transaction',
            },
            children: [ //子菜单配置
              {
                name: '1234',
                path: 'myPage12',
                meta: {
                  icon: 'transaction',
                },
              }
            ]
          }];
          this.setMenuData(a);

        console.log('1234');
      }
    }
  }
</script>

<style scoped>

</style>
